import axios from "axios"
const request=axios.create({
    timeout:5000,
})

request.interceptors.request.use((config)=>{
    let token=localStorage.getItem('token')
    if(token){
        config.headers={
            ...config.headers,
            Authorization:token
        }
    }
    return config
})

request.interceptors.response.use((config)=>{
    return config.data
},(err)=>{
    return Promise.reject(err)
})
export default request